home *** CD-ROM | disk | FTP | other *** search
-
- TITLE SEMICOLON_REVERSE
-
- ; by William C. Parke for George Page and CHUG Aug. 1988
- ;
- ; This program is a Terminate-and-Stay-Resident routine which
- ; converts a semicolon to a colon and visa-versa when typed
- ; from the keyboard. For those not drilled into QWERTY
- ; typing, the often used DOS colon is easier to type, not
- ; requiring a shift with the semicolon key. Install the
- ; program in the AUTOEXEC.BAT file after testing.
-
- ; Use DOS 2.11 or higher.
-
- ; The resident portion of the program takes only 256 bytes.
- ; (It is actually contained in the original Program Segment
- ; Prefix. The child environment is de-allocated.)
-
- ; This file assembled under MASM Version 4.0.
-
- COD SEGMENT BYTE PUBLIC 'CODE'
- ASSUME CS:COD, DS:COD, ES:COD, SS:COD
-
- ORG 100H
-
- BEGIN: JMP INIT ; initialize TSR for int 16h interception
-
- INT16: CMP AH,2 ; int 16h function index
- JC NEW16 ; request for next char
- DB 0EAH ; far jump code
- JOFS DW 0 ; original INT 16h vector
- JSEG DW 0
- NEW16: PUSH BP
- PUSH DX
- MOV BP,SP
- MOV DX,[BP+8] ; get user flag
- PUSH DX ; anticipate IRET after call
- DB 9AH ; far call code
- COFS DW 0
- CSEG DW 0
- PUSHF
- POP DX ; recover int 16h flags
- MOV [BP+8],DX ; set user flag
- POP DX
- POP BP
- CMP AH,27H ; scan code for colon key
- JNZ EXIT
- XOR AL,1 ; reverse to 3A/3B
- EXIT: IRET
-
- INIT: MOV DX,OFFSET MSG ; tell user what will happen
- MOV AH,9
- INT 21H
- XOR AX,AX
- MOV ES,AX ; set for bios data segment
- AND BYTE PTR ES:[0417H],0DFH ; turn off NumLock
- MOV ES,DS:[002CH] ; environ segment
- MOV AH,49H ; free up environment
- INT 21H
- MOV AX,3516H ; get vector for int 16h
- INT 21H
- MOV JOFS,BX ; set double word far jump
- MOV JSEG,ES
- MOV COFS,BX ; set double word far call
- MOV CSEG,ES
- MOV AX,CS
- MOV ES,AX
- MOV DI,80H ; use wasted psp buffer area
- MOV SI,OFFSET BEGIN
- MOV CX,40H
- REP MOVSW ; move handler down to org 80h
- MOV DX,OFFSET INT16 - 80H ; handler start address
- MOV AX,2516H ; install keyboard preprocessor
- INT 21H
- MOV DX,10H ; para size of our interrupt handler
- MOV AX,3100H ; terminate and stay resident
- INT 21H
-
- MSG DB 13,10,'Colon-Semicolon Reversed.'
- DB 13,10,10,'$ COLON Version 1.0 ',13,10
- DB 'William C. Parke for CHUG, 1988',13,10,10,'$'
-
- COD ENDS
- END BEGIN
-